package com.yonyou.cyxdms.sysAuth.service.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


/**
 * <p>
 * 顾问工作时间
 * </p>
 *
 * @author tanjie
 * @since 2019-08-29
 */

public class ConsultantWorkDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long consultantWorkId;
    /**
     * 顾问ID
     */
    @ApiModelProperty("顾问ID")
    private String consultantId;
    /**
     * 所属经销商CODE
     */
    @ApiModelProperty("所属经销商CODE")
    private String ownerCode;
    /**
     * phone
     */
    private String phone;
    /**
     * name
     */
    private String name;
    /**
     * 该顾问工作时间(单位星期,多个星期使用&分割)
     */
    private String workTime;
    /**
     * 当前顾问分配线索权重比
     */
    private Integer consultantRatio;
    /**
     * 当天接收到的线索数
     */
    private Integer cluesByDay;
    /**
     * 线索数有效时间
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime cluesDayValid;
    /**
     * 可分配来源
     */
    private String sourceType;

    /**
     * 是否可分配
     */
    private Integer isAllot;
    /**
     * 逻辑删除标志：是否删除
     */
    private Boolean isDeleted;
    /**
     * 格式化有效线索日期
     */
    private List<Integer> date;

    public ConsultantWorkDTO() {
        super();
    }


    public Long getConsultantWorkId() {
        return consultantWorkId;
    }


    public void setConsultantWorkId(Long consultantWorkId) {
        this.consultantWorkId = consultantWorkId;
    }


    public String getConsultantId() {
        return consultantId;
    }


    public void setConsultantId(String consultantId) {
        this.consultantId = consultantId;
    }


    public String getOwnerCode() {
        return ownerCode;
    }


    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }


    public String getWorkTime() {
        return workTime;
    }


    public void setWorkTime(String workTime) {
        this.workTime = workTime;
    }


    public Integer getConsultantRatio() {
        return consultantRatio;
    }


    public void setConsultantRatio(Integer consultantRatio) {
        this.consultantRatio = consultantRatio;
    }


    public Integer getCluesByDay() {
        return cluesByDay;
    }


    public void setCluesByDay(Integer cluesByDay) {
        this.cluesByDay = cluesByDay;
    }

    public List<Integer> getDate() {
        return date;
    }

    public void setDate(List<Integer> date) {
        this.date = date;
    }

    public LocalDateTime getCluesDayValid() {
        return cluesDayValid;
    }


    public void setCluesDayValid(LocalDateTime cluesDayValid) {
        this.cluesDayValid = cluesDayValid;
    }


    public String getSourceType() {
        return sourceType;
    }


    public void setSourceType(String sourceType) {
        this.sourceType = sourceType;
    }


    public Integer getIsAllot() {
        return isAllot;
    }

    public void setIsAllot(Integer isAllot) {
        this.isAllot = isAllot;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public Boolean getDeleted() {
        return isDeleted;
    }


    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    public String toString() {
        return "ConsultantWorkDTO{" +
                "consultantWorkId=" + consultantWorkId +
                ", consultantId='" + consultantId + '\'' +
                ", ownerCode='" + ownerCode + '\'' +
                ", phone='" + phone + '\'' +
                ", name='" + name + '\'' +
                ", workTime='" + workTime + '\'' +
                ", consultantRatio=" + consultantRatio +
                ", cluesByDay=" + cluesByDay +
                ", cluesDayValid=" + cluesDayValid +
                ", sourceType='" + sourceType + '\'' +
                ", isAllot=" + isAllot +
                ", isDeleted=" + isDeleted +
                ", date=" + date +
                '}';
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author tanjie
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author tanjie
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "consultantWorkId");
    }

}
